package com.kaishengit.web;


import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.kaishengit.dao.TDao;
import com.kaishengit.entity.Ep;
import com.kaishengit.entity.Task;

public class MyTaskServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void destroy() {
	}
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		HttpSession session=request.getSession();
		Ep ep=(Ep)session.getAttribute("ep");
		TDao tdao=new TDao();
		List<Task> tlist=tdao.findByEmployeeid(ep.getEmployeeid());
		session.setAttribute("tlist",tlist);
		request.getRequestDispatcher("/WEB-INF/views/mytask.jsp").forward(request, response);
		
	}
	
	public void init() throws ServletException {
	}

}
